import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.awt.Color;
import java.awt.Font;

/**
 * Write a description of class Display here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Display extends Actor
{
    public Display(String message)
    {
        GreenfootImage image=new GreenfootImage(message.length()*16,100);
        image.clear();
        image.setColor(new Color(0,0,0,0));
        image.fill();
        image.setColor(new Color(255,255,255,255));
        image.setFont(new Font("Impact",Font.PLAIN,32));
        image.drawString(message,0,image.getHeight()/2+10);
        setImage(image);
    }
    
    public Display(String message,int fontSize)
    {
        GreenfootImage image=new GreenfootImage(message.length()*fontSize/2,25);
        image.clear();
        image.setColor(new Color(0,0,0,100));
        image.fill();
        image.setColor(new Color(255,255,255,255));
        image.setFont(new Font("Impact",Font.PLAIN,fontSize));
        image.drawString(message,0,image.getHeight()/2+10);
        setImage(image);
    }
    
    
    public void act() 
    {
        // Add your action code here.
    }
    
}
